package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;

import java.util.concurrent.TimeUnit;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    public String methodA(String name) {
        int mCounts = (int) (Math.random() * 100);
        try {
            Thread.sleep(mCounts);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA:" + name + "睡眠时间是：" + mCounts;
    }

    @Override
    public String methodB(String name) {
        int mCounts = (int) (Math.random() * 100);
        try {
            Thread.sleep(mCounts);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB:" + name + "睡眠时间是：" + mCounts;
    }

    @Override
    public String methodC(String name) {
        int mCounts = (int) (Math.random() * 100);
        try {
            Thread.sleep(mCounts);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC:" + name + "睡眠时间是：" + mCounts;
    }
}
